/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 东莞呵呵
 * Date:2022-05-03
 * Time:21:29
 */

abstract class A{
    public abstract void print();
}

abstract class B extends A{
    public abstract void display();
}

class C extends B{
    @Override
    public void print() {
        System.out.println("print");
    }

    @Override
    public void display() {
        System.out.println("display");
    }
}

public class TestDemo {
    public static void main(String[] args) {
        A a=new C();
        B b=new C();
        b.display();
    }
}
//通过继承抽象类A的抽象类B引用的子类对象可以调用重写过的A中的方法